/*
package cn.itcast.service.cargo;

import cn.itcast.dao.cargo.ExportDao;
import cn.itcast.dao.cargo.ExportProductDao;
import cn.itcast.domain.cargo.BackgroundCount;
import cn.itcast.domain.cargo.Export;
import cn.itcast.domain.cargo.ExportExample;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Arrays;
import java.util.List;

public class PackingServiceImpl implements PackingService{

    @Autowired
    private ExportDao exportDao;
    @Autowired
    private ExportProductDao exportProductDao;


    @Override
    public Packing findById(String id) {
        return PackingDao.selectByPrimaryKey(id);
    }

    @Override
    public void save(Packing packing) {
        //根据报运单id

        PackingDao.insertSelective(packing);
    }

    */
/**
     * 后套自动计算传入
     * @param id
     * @return
     *//*

    @Override
    //这里只有报运单id字符串进来
    public void count(String id) {
        //获取报运单id
        String[] array = id.split(",");
        List<String> packingIdList = Arrays.asList(array);

        BackgroundCount backgroundCount = new BackgroundCount();

        //根据报运单id
        //先获取报运单对象
        ExportExample exportExample = new ExportExample();
        exportExample.createCriteria().andIdIn(packingIdList);
        List<Export> exportList = exportDao.selectByExample(exportExample);
        if(exportList!=null && exportList.size()>0){
            //1.获取合同号
            String customerContractNos = "";
            for (Export export : exportList) {
                //获取合同号
                customerContractNos = export.getCustomerContract()+" ";
                //****这里需要测试，看展现效果是用空格还是逗号

            }
            backgroundCount.setCustomerContractNos(customerContractNos);
            backgroundCount.setGrossWeights();
            //获取总毛重


        }

        //2.获取总毛重


    }

    @Override
    public void delete(String id) {
        PackingDao.deleteByPrimaryKey(id);
    }

    @Override
    public List<Packing> findAll(PackingExample packingExample) {
        return PackingDao.selectByExample(packingExample);
    }

    @Override
    public PageInfo<Packing> findByPage(
            PackingExample example, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Packing> list = PackingDao.selectByExample(example);
        return new PageInfo<>(list);
    }
}
*/
